Let serial (and only serial) NMEA reader accept a 'bad' position, but mark it so...
authorrobertl <robertl>
Wed, 18 Oct 2006 22:38:44 +0000 (22:38 +0000)
committerrobertl <robertl>
Wed, 18 Oct 2006 22:38:44 +0000 (22:38 +0000)
nmea.c

diff --git a/nmea.c b/nmea.c
index 012333f4b69c4446086586811a6ea4ba7692f408..fd18320dce503d0b4f1b1ac86991a41f4991baea 100644 (file)
--- a/nmea.c
+++ b/nmea.c
@@ -373,7 +373,12 @@ gpgga_parse(char *ibuf)
                &lngdeg,&lngdir,
                &fix,&nsats,&hdop,&alt,&altunits);
 
-       if (fix == 0) {
+       /*
+        * In serial mode, allow the fix with an invalid position through
+        * as serial units will often spit a remembered position up and
+        * that is more comfortable than nothing at all...
+        */
+       if ((fix == 0) && (read_mode != rm_serial)) {
                return;
        }
 
@@ -402,6 +407,9 @@ gpgga_parse(char *ibuf)
        waypt->hdop     = hdop;
 
        switch (fix) {
+               case 0:
+                       waypt->fix = fix_none;
+                       break;
                case 1:
                        waypt->fix  = (nsats>3)?(fix_3d):(fix_2d);
                        break;